package com.linkvin.ec.hcs.service.util.enums;

import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;

public enum WarehouseStyleEnum {

    //仓库属性 10：简易库 20：标准库'
    SIMPLE("10", "简易仓库"),
    STANDARD("20", "标准仓库");

    private final String value;
    private final String text;

    private static final Map<String, String> lookup = new HashMap<>();

    static {
        for (WarehouseStyleEnum s : EnumSet.allOf(WarehouseStyleEnum.class)) {
            lookup.put(s.getValue(),s.getText());
        }
    }

    WarehouseStyleEnum(String value, String text) {
        this.value = value;
        this.text = text;
    }

    /**
     * Gets value.
     *
     * @return the value
     */
    public String getValue() {
        return value;
    }

    /**
     * Gets text.
     *
     * @return the text
     */
    public String getText() {
        return text;
    }

    /**
     *
     * @param value
     * @return
     */
    public static WarehouseStyleEnum getByValue(String value) {
        for (WarehouseStyleEnum temp : WarehouseStyleEnum.values()) {
            if (temp.getValue().equals(value)) {
                return temp;
            }
        }
        return null;
    }

    /***
     * 得到所有的值
     * @return
     */
    public static Map<String, String> lookup() {
        return lookup;
    }

}
